package com.example.tasks.shop

import com.google.gson.Gson
import okio.buffer
import okio.source
import java.io.File

/**
 * 检查shop feature iap
 */
fun main() {
    val content = File("F:\\download\\download\\allShop_new.txt").source().buffer().readUtf8()
    val response = Gson().fromJson<Response>(content, Response::class.java)
//    val table = HashMap<String, MutableList<Int>>(response.data?.tagMap?.size ?: 4)
    response.data?.tagMap
    val makeupIds = setOf<Int>(3, 4, 6, 8, 9)
    response.data?.shopList?.forEach { shopIap ->
        if (shopIap.isFree == 0 && (shopIap.shopType !in makeupIds)) println("shopType:${shopIap.shopType},code:${shopIap.code},store:${shopIap.store}")
/*        shopIap.tags?.forEach {
            if (!table.containsKey(it)) {
                table[it] = ArrayList(40)
            }
            table[it]?.add(shopIap.id)
        }*/
    }
/*    var count = 0
    table.forEach { t, u ->
        count += u.size
        println("$t has ${u.size} : $u")
    }
    println("data has ${response.data?.shopList?.size ?: 0}, count:$count")*/
}